package com.lablzh.gdxy.repository.admin;

import com.lablzh.gdxy.entity.admin.Category;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;

import javax.transaction.Transactional;
import java.util.List;

public interface CategoryRepository extends JpaRepository<Category,Integer> {
    Category findByCategoryName(String categoryName);
    List<Category> findAllByCourseTeacherName(String CourseTeacherName, Sort sort);
    List<Category> findAllByColumnName(String columnName);
//    void deleteCategoriesByColumnName(String columnName);
//    void deleteByColumnName(String columnName);
    @Transactional
    void deleteAllByColumnName(String columnName);
}

